home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / REmovido / Esportes / FlashGOL.swf / scripts / frame_2 / DoAction.as
Text File  |  2006-06-13  |  3KB  |  129 lines

  1. _quality = "HIGH";
  2. stopAllSounds();
  3. movieClip.prototype.multi = 10;
  4. movieClip.prototype.vel = 5;
  5. MovieClip.prototype.x0 = 320;
  6. MovieClip.prototype.y0 = 240;
  7. MovieClip.prototype.Fescala = 4;
  8. MovieClip.prototype.Dfocal = 200;
  9. MovieClip.prototype.FNpunto3D = function()
  10. {
  11.    Pfocal = Dfocal / (z + Dfocal);
  12.    escala = Pfocal * Fescala;
  13.    Xpos = Pfocal * x + x0;
  14.    Ypos = Pfocal * y + y0;
  15. };
  16. MovieClip.prototype.FNsitua3D = function()
  17. {
  18.    _xscale = _yscale = escala;
  19.    _X = Xpos;
  20.    _Y = Ypos;
  21.    _alpha = 100;
  22. };
  23. MovieClip.prototype.FNcos = function(n)
  24. {
  25.    var grados = Math.cos(n * 3.141592653589793 / 180);
  26.    return grados;
  27. };
  28. MovieClip.prototype.FNsin = function(n)
  29. {
  30.    var grados = Math.sin(n * 3.141592653589793 / 180);
  31.    return grados;
  32. };
  33. MovieClip.prototype.FNtan = function(n)
  34. {
  35.    var grados = Math.sin(n * 3.141592653589793 / 180) / Math.cos(n * 3.141592653589793 / 180);
  36.    return grados;
  37. };
  38. MovieClip.prototype.FNasin = function(n)
  39. {
  40.    var grados = Math.asin(n);
  41.    grados = grados * 180 / 3.141592653589793;
  42.    return grados;
  43. };
  44. MovieClip.prototype.FNacos = function(n)
  45. {
  46.    var grados = Math.acos(n);
  47.    grados = grados * 180 / 3.141592653589793;
  48.    return grados;
  49. };
  50. MovieClip.prototype.FNatan = function(n)
  51. {
  52.    var grados = Math.atan(n);
  53.    grados = grados * 180 / 3.141592653589793;
  54.    return grados;
  55. };
  56. MovieClip.prototype.FNdistancia = function(x1, y1, x2, y2)
  57. {
  58.    var dist = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  59.    return dist;
  60. };
  61. MovieClip.prototype.FNangulo = function(x1, y1, x2, y2)
  62. {
  63.    y1 >= y2 ? (ang = 90 + Math.atan((x1 - x2) / (y1 - y2)) * 180 / 3.141592653589793) : (ang = 270 + Math.atan((x1 - x2) / (y1 - y2)) * 180 / 3.141592653589793);
  64.    return ang;
  65. };
  66. MovieClip.prototype.FNPuntos = function(x1, y1, x2, y2, objeto)
  67. {
  68.    var angulo = null;
  69.    y1 >= y2 ? (angulo = 90 + Math.atan((x1 - x2) / (y1 - y2)) * 180 / 3.141592653589793) : (angulo = 270 + Math.atan((x1 - x2) / (y1 - y2)) * 180 / 3.141592653589793);
  70.    var dix = x2 - x1;
  71.    var diy = y2 - y1;
  72.    var distancia = Math.sqrt(dix * dix + diy * diy);
  73.    eval(objeto)._x = x1;
  74.    eval(objeto)._y = y1;
  75.    eval(objeto)._rotation = -90 - angulo;
  76.    eval(objeto)._xscale = eval(objeto)._yscale = distancia / 10;
  77. };
  78. MovieClip.prototype.FNrotarX = function(angulo)
  79. {
  80.    var subY = y;
  81.    var subZ = z;
  82.    y = FNcos(angulo) * suby - FNsin(angulo) * subz;
  83.    z = FNsin(angulo) * suby + FNcos(angulo) * subz;
  84. };
  85. MovieClip.prototype.FNrotarY = function(angulo)
  86. {
  87.    var subX = x;
  88.    var subZ = z;
  89.    z = FNcos(angulo) * subZ - FNsin(angulo) * subX;
  90.    x = FNcos(angulo) * subX + FNsin(angulo) * subZ;
  91. };
  92. MovieClip.prototype.FNrotarZ = function(angulo)
  93. {
  94.    var subX = x;
  95.    var subY = y;
  96.    x = FNcos(angulo) * subX - FNsin(angulo) * subY;
  97.    y = FNsin(angulo) * subX + FNcos(angulo) * subY;
  98. };
  99. MovieClip.prototype.FNescala = function(factor, incX, incY)
  100. {
  101.    _xscale = _yscale = 100 + 25 * factor;
  102.    _X = -80 * factor + incX;
  103.    _Y = -80 * factor + incY;
  104. };
  105. MovieClip.prototype.FNrgb = function(r, g, b)
  106. {
  107.    c = new Color(this);
  108.    r = r.toString(16);
  109.    g = g.toString(16);
  110.    b = b.toString(16);
  111.    if(g.length < 2)
  112.    {
  113.       g = "0" + g;
  114.    }
  115.    if(b.length < 2)
  116.    {
  117.       b = "0" + b;
  118.    }
  119.    if(r.length < 2)
  120.    {
  121.       c.setRGB(parseInt("0x0" + r + g + b));
  122.    }
  123.    else
  124.    {
  125.       c.setRGB(parseInt("0x" + r + g + b));
  126.    }
  127. };
  128. cnt = "MAD";
  129.